package com.edu.chat.facade.model.enums;

import lombok.Getter;

/**
 * @program: KQAIA
 * @description:
 * @author: 无恙
 * @create: 2025-03-23 18:34
 **/

@Getter
public enum MsgTypeEnum {

	//机器消息
	ROBOT("robot","机器人消息"),
	//用户消息
	USER("user","用户消息");

	private final String code;

	private final String desc;

	MsgTypeEnum (String code,String desc){
		this.code = code;
		this.desc = desc;
	}

	public static MsgTypeEnum getByCode(String code){
		for (MsgTypeEnum msgTypeEnum : MsgTypeEnum.values()) {
			if (msgTypeEnum.code.equals(code)) {
				return msgTypeEnum;
			}
		}
		return null;
	}
}
